package com.tongzhou.tongzhou.quot.dao.impl;

import org.apache.commons.dbutils.handlers.BeanHandler;

import com.tongzhou.db.DBUtil;
import com.tongzhou.db.exception.DBException;
import com.tongzhou.tongzhou.quot.dao.IQuotRemarkDAO;
import com.tongzhou.tongzhou.quot.model.PaperType;
import com.tongzhou.tongzhou.quot.model.QuotRemark;
import com.tongzhou.util.Util;

public class QuotRemarkDAO implements IQuotRemarkDAO{

	@Override
	public QuotRemark getQuotRemarkById(int id) throws DBException {
		StringBuffer sql=new StringBuffer();
		sql.append("select  id,remark ");
		sql.append(" from quot_remark ");
		sql.append(" where id='"+id+"'");
		QuotRemark quotRemark=DBUtil.query(sql.toString(), new BeanHandler<QuotRemark>(QuotRemark.class));
		return quotRemark;
	}

	@Override
	public void updateQuotRemark(QuotRemark quotRemark) throws DBException {
		StringBuffer sql=new StringBuffer();
		sql.append("update quot_remark set ");
		sql.append("remark='"+Util.changeToObj(quotRemark.getRemark())+"' ");
		sql.append("where id='"+quotRemark.getId()+"'");
		DBUtil.update(sql.toString());
	}
	
}
